package com.xinpu.service.impl;

import com.xinpu.dto.FollowDto;
import com.xinpu.mapper.FollowMapper;
import com.xinpu.service.FollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * FollowServiceImpl
 *
 * @author ayuan
 * @date 2021/4/20
 */
@Service
public class FollowServiceImpl implements FollowService {

    @Autowired
    private FollowMapper followMapper;

    /**
     * 跟进记录
     *
     * @param uid
     * @return
     */
    @Override
    public List<FollowDto> getList(Integer uid) {
        return followMapper.getList(uid);
    }

    /**
     * 跟进统计
     *
     * @param type 2签到 3跟进
     * @param sid
     * @param day
     * @return
     */
    @Override
    public int followCount(Integer type, Integer sid, Integer day) {
        return followMapper.followCount(type, sid, day);
    }

    /**
     * 用户或线索跟进统计
     *
     * @param type 0客户1线索
     * @param pid
     * @param day
     * @return
     */
    @Override
    public int userOrClueFollowCount(Integer type, Integer pid, Integer day) {
        return followMapper.userOrClueFollowCount(type, pid, day);
    }
}
